<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app1">
    <my-btn></my-btn>
    <div>
        <my-btn></my-btn>
    </div>
</div>

<div id="app2">
    <my-btn></my-btn>
</div>

<my-btn></my-btn>


</body>
<script>
  // 注册组件 Vue.component('组件名', {配置对象});
    Vue.component('my-btn', {
        template: '<button style="width: 100px; height: 30px; background-color: aquamarine;">自定按钮</button>'
    });

    let app1 = new Vue({
        el: '#app1'
    });

    let app2 = new Vue({
        el: '#app2'
    });

</script>
</html>
